<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>RaftLib: Allocate Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">RaftLib
   &#160;<span id="projectnumber">0.3a</span>
   </div>
   <div id="projectbrief">C++ Stream Processing Template Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="class_allocate-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Allocate Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for Allocate:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="class_allocate__inherit__graph.svg" width="170" height="118"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for Allocate:</div>
<div class="dyncontent">
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="class_allocate__coll__graph.svg" width="100%" height="600"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div></div>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a61d8b01e404c23ead20068035e3ba540"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_allocate.html#a61d8b01e404c23ead20068035e3ba540">Allocate</a> (<a class="el" href="class_map.html">Map</a> &amp;map, volatile bool &amp;<a class="el" href="class_allocate.html#a4d10076b88ab1297c89b8a05e117b510">exit_alloc</a>)</td></tr>
<tr class="separator:a61d8b01e404c23ead20068035e3ba540"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68cd61da26f3b82da094b6d3e5d556f5"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_allocate.html#a68cd61da26f3b82da094b6d3e5d556f5">~Allocate</a> ()</td></tr>
<tr class="separator:a68cd61da26f3b82da094b6d3e5d556f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44f9b51c382fec159233609e21b9d272"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_allocate.html#a44f9b51c382fec159233609e21b9d272">run</a> ()=0</td></tr>
<tr class="separator:a44f9b51c382fec159233609e21b9d272"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3123c2c1d9584974ce19b47fe6ceea17"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_allocate.html#a3123c2c1d9584974ce19b47fe6ceea17">waitTillReady</a> ()</td></tr>
<tr class="separator:a3123c2c1d9584974ce19b47fe6ceea17"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a1d5c71b5cd6fc9671ed82d9c1d04965c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_allocate.html#a1d5c71b5cd6fc9671ed82d9c1d04965c">initialize</a> (<a class="el" href="struct_port_info.html">PortInfo</a> *const src, <a class="el" href="struct_port_info.html">PortInfo</a> *const dst, <a class="el" href="class_f_i_f_o.html">FIFO</a> *const fifo)</td></tr>
<tr class="separator:a1d5c71b5cd6fc9671ed82d9c1d04965c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a901eb0fdb6cffd56019c9ab9f2b25f92"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a901eb0fdb6cffd56019c9ab9f2b25f92"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>allocate</b> (<a class="el" href="struct_port_info.html">PortInfo</a> &amp;a, <a class="el" href="struct_port_info.html">PortInfo</a> &amp;b, void *data)</td></tr>
<tr class="separator:a901eb0fdb6cffd56019c9ab9f2b25f92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4cf36bb704e43f5736a0e736d9e1a81b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_allocate.html#a4cf36bb704e43f5736a0e736d9e1a81b">setReady</a> ()</td></tr>
<tr class="separator:a4cf36bb704e43f5736a0e736d9e1a81b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a93e612d7ea7eb686fc88b5dee7a1407b"><td class="memItemLeft" align="right" valign="top">kernelkeeper &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_allocate.html#a93e612d7ea7eb686fc88b5dee7a1407b">source_kernels</a></td></tr>
<tr class="separator:a93e612d7ea7eb686fc88b5dee7a1407b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a91e8c7d69ab7b309ea45439aea54fb4f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a91e8c7d69ab7b309ea45439aea54fb4f"></a>
kernelkeeper &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>all_kernels</b></td></tr>
<tr class="separator:a91e8c7d69ab7b309ea45439aea54fb4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a037410210c0d10578f87de1ec68f47ba"><td class="memItemLeft" align="right" valign="top">std::set&lt; <a class="el" href="class_f_i_f_o.html">FIFO</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_allocate.html#a037410210c0d10578f87de1ec68f47ba">allocated_fifo</a></td></tr>
<tr class="separator:a037410210c0d10578f87de1ec68f47ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d10076b88ab1297c89b8a05e117b510"><td class="memItemLeft" align="right" valign="top">volatile bool &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_allocate.html#a4d10076b88ab1297c89b8a05e117b510">exit_alloc</a></td></tr>
<tr class="separator:a4d10076b88ab1297c89b8a05e117b510"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a901ac6fe1c35f3c114cf9e83f75dde0c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a901ac6fe1c35f3c114cf9e83f75dde0c"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>basic_parallel</b></td></tr>
<tr class="separator:a901ac6fe1c35f3c114cf9e83f75dde0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a61d8b01e404c23ead20068035e3ba540"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Allocate::Allocate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_map.html">Map</a> &amp;&#160;</td>
          <td class="paramname"><em>map</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">volatile bool &amp;&#160;</td>
          <td class="paramname"><em>exit_alloc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><a class="el" href="class_allocate.html">Allocate</a> - base constructor, really doesn't do too much save for setting the global variables all_kernels and source_kernels from the <a class="el" href="class_map.html">Map</a> object. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">map</td><td>- <a class="el" href="class_map.html">Map</a>&amp; </td></tr>
    <tr><td class="paramname">exit_alloc</td><td>- bool used to terminate loop, for monitoring allocations, controlled by map object.</td></tr>
  </table>
  </dd>
</dl>
<p>allocate.cpp - </p><dl class="section author"><dt>Author</dt><dd>: Jonathan Beard </dd></dl>
<dl class="section version"><dt>Version</dt><dd>: Tue Sep 16 20:20:06 2014</dd></dl>
<p>Copyright 2014 Jonathan Beard</p>
<p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:</p>
<p><a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a></p>
<p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. </p>

</div>
</div>
<a class="anchor" id="a68cd61da26f3b82da094b6d3e5d556f5"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Allocate::~Allocate </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>destructor </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a1d5c71b5cd6fc9671ed82d9c1d04965c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Allocate::initialize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_port_info.html">PortInfo</a> *const&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_port_info.html">PortInfo</a> *const&#160;</td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_f_i_f_o.html">FIFO</a> *const&#160;</td>
          <td class="paramname"><em>fifo</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>initialize - internal method to be used within the run method takes care of the initialization using the already allocated <a class="el" href="class_f_i_f_o.html">FIFO</a> object passed as a param. This function will throw an exception if either port (src or dst) have already been allocated. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>- PortInfo*, nullptr if not to be set </td></tr>
    <tr><td class="paramname">dst</td><td>- PortInfo*, nullptr if not to be set </td></tr>
    <tr><td class="paramname">fifo</td><td>- FIFO* </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="class_port_double_initialize_exception.html">PortDoubleInitializeException</a></td><td>- if either port is already initialized. </td></tr>
  </table>
  </dd>
</dl>
<p>NOTE: this list simply speeds up the monitoring if we want it </p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><!-- SVG 0 -->
</div>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><!-- SVG 1 -->
</div>
</div>
</p>

</div>
</div>
<a class="anchor" id="a44f9b51c382fec159233609e21b9d272"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void Allocate::run </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>run - implement this function to create a new allocator, will be run inside a thread so exits when done but if run-time monitoring is desired then this is the place to do it. </p>

<p>Implemented in <a class="el" href="classstdalloc.html#a60438b15948ce354b52b03ba6d975de0">stdalloc</a>, and <a class="el" href="classdynalloc.html#a2a52b86ec09bd6dd52e49062137b2e37">dynalloc</a>.</p>

</div>
</div>
<a class="anchor" id="a4cf36bb704e43f5736a0e736d9e1a81b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Allocate::setReady </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>setReady - call within the implemented run function to signal that the initial allocations have been completed. </p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="class_allocate_a4cf36bb704e43f5736a0e736d9e1a81b_icgraph.svg" width="291" height="90"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</p>

</div>
</div>
<a class="anchor" id="a3123c2c1d9584974ce19b47fe6ceea17"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Allocate::waitTillReady </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>waitTillReady - call after initializing the allocate thread, returns when the initial allocation is complete. </p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a037410210c0d10578f87de1ec68f47ba"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::set&lt; <a class="el" href="class_f_i_f_o.html">FIFO</a>* &gt; Allocate::allocated_fifo</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>keeps a list of all currently allocated <a class="el" href="class_f_i_f_o.html">FIFO</a> objects, set from within the initialize function. </p>

</div>
</div>
<a class="anchor" id="a4d10076b88ab1297c89b8a05e117b510"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">volatile bool&amp; Allocate::exit_alloc</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>exit_alloc - bool whose value is set by the map object, controls when the loop within the alloc thread is exited. </p>

</div>
</div>
<a class="anchor" id="a93e612d7ea7eb686fc88b5dee7a1407b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">kernelkeeper&amp; Allocate::source_kernels</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>both convenience structs, hold exactly what the names say </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="allocate_8hpp_source.html">allocate.hpp</a></li>
<li>allocate.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Oct 12 2015 12:16:50 for RaftLib by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
